﻿using System;
using System.Collections.Generic;
using System.Text;
using DeepHash.CommandParser;
using DeepHash.Document;
using DeepHash.Document.Format;

namespace DeepHash.Run
{
    class VerifyCommand //: CommandBase
    {
        private string _path = string.Empty;
        [CommandParameter("path")]
        public string Path
        {
            get { return _path; }
            set { _path = value; }
        }

        private string _folder = string.Empty;
        [CommandParameter("folder")]
        public string Folder
        {
            get { return _folder; }
        }
         
        public void Execute()
        {
            VerificationDocument baseDoc = VerificationDocument.LoadFromFile(this.Path, new TextDocumentFormatter());
            DirectoryWalker walker = new DirectoryWalker();
            VerificationDocument doc =  walker.WalkDirectory(this.Folder, new MD5HashAlgorithem(),
                true, null);
            DocumentComparer comparer = new DocumentComparer(baseDoc, "Ref ", doc, "live");
            comparer.Compare();

        }
    }
}
